<?php

namespace App\Http\Controllers\YApi;

//use Illuminate\Http\Request;
use Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;

use Session;
use Redirect;

use App\Models\UsersReg;
use App\Models\Book;
use App\Models\BooksPingfen;

class BookinfoController extends Controller
{

    public function bookinfo($book_id)
    {
        //书籍信息
        $bookinfo = Book::find($book_id);

        $uid = request::input('uid');

        $bookinfo['readstate'] = BooksPingfen::where('book_id', $book_id)->where('uid', $uid)->first();
        
        return $bookinfo;
    }
    
}